﻿// -------------------------------------------------------------------------
//    @FileName         :    NFIWorldPlayerModule.h
//    @Author           :    gaoyi
//    @Date             :   2023-07-10
//    @Email			:    445267987@qq.com
//    @Module           :    NFIWorldPlayerModule
//
// -------------------------------------------------------------------------

#pragma once

#include "Player/NFPlayerMgr.h"
#include "NFLogicCommon/NFMMODynamicModule.h"

class NFCLogicPlayerModule : public NFMMODynamicModule
{
public:
	explicit NFCLogicPlayerModule(NFIPluginManager* p);
	~NFCLogicPlayerModule() override;

	int Awake() override;

    int Init() override;

	int Tick() override;

	int OnDynamicPlugin() override;

public:
    /**
     * @brief 处理客户端消息
     * @param unLinkId
     * @param packet
     * @return
     */
	int OnHandleClientMessage(uint32_t msgId, NFDataPackage& packet, uint64_t param1, uint64_t param2) override;

	/**
	 * @brief 处理来自服务器的信息
	 * @param unLinkId
	 * @param packet
	 * @return
	 */
	int OnHandleServerMessage(uint32_t msgId, NFDataPackage& packet, uint64_t param1, uint64_t param2) override;

public:
	int AfterAllConnectAndAllDescStore(NF_SERVER_TYPE serverType) override;
	int AfterObjFromDBLoaded(NF_SERVER_TYPE serverType) override;
public:
    int OnHandleServerOtherMessage(uint64_t unLinkId, NFDataPackage &packet);
};
